var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

router.get('/user/:username', function (req, res, next) {
    //res.send('all method'); //已经调用了send方法的路由不能被转移
    next();
});
/* 定义在后面的路由匹配将被忽略，除非路由转移了 */
router.get('/user/:username', function (req, res, next) {
    res.send('user: ' + req.params.username);
});


module.exports = router;
